﻿<!DOCTYPE HTML
    PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <!-- 左侧资源树 -->
    <title>土地调查数据共享服务云平台</title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport" />
    <link rel="stylesheet" href="/css/bootstrap.min.css" />
    <link href="/css/BasePlatform/Main/AdminLTE.min.css" rel="stylesheet" type="text/css" />
    <!--<link rel="stylesheet" href="/css/font-awesome.min.css">
    <link href="/css/_all-skins.min.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="/css/header.css">-->
    <script src="/scripts/PublicJS/basepublic.js" type="text/javascript"></script>
    <style>

        /* 滚动条整体样式(高宽分别对应横竖滚动条的尺寸) */

        body::-webkit-scrollbar {
            width: 10px;
            height: 10px;
        }


        /* 滚动条里面小方块 */

        body::-webkit-scrollbar-thumb {
            border-radius: 10px;
            -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
            background: rgba(85, 229, 38, 0.71);
        }


        /* 滚动条里面轨道 */

        body::-webkit-scrollbar-track {
            -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
            border-radius: 10px;
            background: #2a4fd1b3;
        }
    </style>
</head>

<body class="hold-transition skin-blue sidebar-mini" style="background-color: #2d3041;"> 
    <section id="sidebar" class="sidebar" style="background-color: #2d3041; top: 20px;">
        <ul class="sidebar-menu" data-widget="tree" id="sidebarmenu">
            <!--<li class="treeview" style="border-top:1px solid #181820; border-bottom:1px solid #181820;
            border-left:1px solid #181820; border-right:0px solid #181820; ">
                   <a href="" style="background-color:#2d3041;" onclick="hrefSub()">
                       <img src="img/datasourcecal.png" style=" width:23px;height:23px; margin-left:10px; margin-top:1px;" />
                       <span style=" margin-left:18px;">数据资源目录</span>
                       <span class="pull-right-container">
                           <i class="fa fa-angle-left pull-right"></i>
                       </span>
                   </a>
                   <ul class="treeview-menu">
                       <li>
                           <a id="sjmljs" href="./src/datasourcecal/querydirectory.html" target="fmain">
                               <img src="img/subcal.png" style=" width:10px;height:10px;margin:auto 16px auto 23px " />
                               <font color="white" size="2.5">数据资源目录快速检索</font>
                           </a>
                       </li>

                   </ul>
               </li>-->

        </ul>
    </section>
</body>
<!-- jQuery 3 -->
<script type="text/javascript" src="/scripts/jquery.min.js"></script>
<!-- jQuery UI 1.11.4 -->
<script src="/scripts/ThirdPart/jquery-ui.min.js"></script>
<script type="text/javascript" src="/scripts/bootstrap.min.js"></script>
<script src="/scripts/adminlte.min.js" type="text/javascript"></script>

<script type="text/javascript" src="/scripts/bootstrap-treeview.js"></script>
<script src="/scripts/BaseP/User/userinfo.js"></script>
<script src="/scripts/BaseP/Resource/Resource.js"></script>
<script src="../../Login.js"></script>
<script src="/scripts/adminlte.min.js" type="text/javascript"></script> 
<!--<script src="/scripts/PublicJS/stringhelper.js"></script>-->
<script type="text/javascript">
    //保存菜单字典<菜单名称，菜单路径>，便于页面切换时判断是否刷新页面
    var dic_menu = new Array();
    //当前页面地址
    var currentPage = "";
    let portaluserno = getCookie ('portalusername') 
    //切换页面至Fmain框架，并且进行页面跳转。 点击左侧项调用这个函数
    function SwitchPageToFmain(url, name, obj) { 
        // url 是跳转的地址  name是点击的名字  obj是 点击的名字的标签
        // 通用应用下所有项目调模型
        var type = $(obj).parent().parent().siblings('a').find('span').html();
        // type 等于 资源 提取分析服务 父级标题
        if (type == '通用应用' || type == '提取分析服务' || type == '叠加分析服务' || type == '专题应用服务' || type == '邻域分析服务' || type == '插值分析服务' || type == '表面分析服务' || type == '距离分析服务' || type == '其它分析服务' || type == '汇总分析服务' || type == '位置查找服务') {
            var text = $(obj).find('font').html(); // 文本信息
            window.parent.showModelDriven(text);
        } else {
            $(parent.window.document).find(".header_tab.selected").removeClass("selected");
            // 不等于上面那些值的话 就开始加载对应的ifarme页面
            if (name == "地图服务") {
                $(parent.window.document).find(".header_tab.header_tab2").addClass("selected");
                if (parent.window.document.getElementById('fmap').style.display == "none") {
                    parent.window.document.getElementById('fmain').style.display = "none";
                    parent.window.document.getElementById('fexplore').style.display = "none";
                    parent.window.document.getElementById('otherIframe').style.display = "none";
                    
                    parent.window.document.getElementById('fmap').style.display = "";

                    //parent.window.document.getElementById("header_tab1").style.background = "url(/img/maintab/tab1.png) no-repeat bottom";
                    //parent.window.document.getElementById("header_tab2").style.background = "url(/img/maintab/tab3.png) no-repeat bottom";
                    //parent.window.document.getElementById("header_tab3").style.background = "url(/img/maintab/tab2.png) no-repeat bottom";
                    //parent.window.document.getElementById("header_tab4").style.background = "url(/img/maintab/tab2.png) no-repeat bottom";
                }
            } else if (name == "通用统计报表服务") {
                $(parent.window.document).find(".header_tab.header_tab4").addClass("selected");
                if (parent.window.document.getElementById('fexplore').style.display == "none") {
                    parent.window.document.getElementById('fmain').style.display = "none";
                    parent.window.document.getElementById('fmap').style.display = "none";
                    parent.window.document.getElementById('otherIframe').style.display = "none";
                    
                    parent.window.document.getElementById('fexplore').style.display = "";

                    //parent.window.document.getElementById("header_tab1").style.background = "url(/img/maintab/tab1.png) no-repeat bottom";
                    //parent.window.document.getElementById("header_tab2").style.background = "url(/img/maintab/tab2.png) no-repeat bottom";
                    //parent.window.document.getElementById("header_tab3").style.background = "url(/img/maintab/tab2.png) no-repeat bottom";
                    //parent.window.document.getElementById("header_tab4").style.background = "url(/img/maintab/tab3.png) no-repeat bottom";
                }
            } else {
                // if (parent.window.document.getElementById('fmain').style.display == "none") {
                //     // parent.window.document.getElementById('fmain').style.display = "";
                //     parent.window.document.getElementById('fmap').style.display = "none";
                //     parent.window.document.getElementById('fexplore').style.display = "none";
                //     parent.window.document.getElementById('otherIframe').style.display = "none";
                // }

                parent.window.document.getElementById('fmain').style.display = "none";
                parent.window.document.getElementById('fmap').style.display = "none";
                parent.window.document.getElementById('fexplore').style.display = "none";
                parent.window.document.getElementById('otherIframe').style.display = "none";

                if (name == "数据资源管理" ||
                    name == "全部资源" ||
                    name == "--地图服务资源" ||
                    name == "--实体数据资源" ||
                    name == "--图件数据资源" ||
                    name == "--文档数据资源" ||
                    name == "模型管理") {
                    parent.window.document.getElementById('fmain').src = url;
                    parent.window.document.getElementById('fmain').style.display = "";
                    $(parent.window.document).find(".header_tab.header_tab1").addClass("selected");
                    //parent.window.document.getElementById("header_tab1").style.background = "url(/img/maintab/tab3.png) no-repeat bottom";
                    //parent.window.document.getElementById("header_tab2").style.background = "url(/img/maintab/tab2.png) no-repeat bottom";
                    //parent.window.document.getElementById("header_tab3").style.background = "url(/img/maintab/tab2.png) no-repeat bottom";
                    //parent.window.document.getElementById("header_tab4").style.background = "url(/img/maintab/tab2.png) no-repeat bottom";
                } else {
                    parent.window.document.getElementById('otherIframe').src = url;
                    parent.window.document.getElementById('otherIframe').style.display = "";
                    //parent.window.document.getElementById("header_tab1").style.background = "url(/img/maintab/tab1.png) no-repeat bottom";
                    //parent.window.document.getElementById("header_tab2").style.background = "url(/img/maintab/tab2.png) no-repeat bottom";
                    //parent.window.document.getElementById("header_tab3").style.background = "url(/img/maintab/tab2.png) no-repeat bottom";
                    //parent.window.document.getElementById("header_tab4").style.background = "url(/img/maintab/tab2.png) no-repeat bottom";
                }

                if (currentPage != dic_menu[name]) {
                    // parent.window.document.getElementById('otherIframe').src = url;
                    currentPage = url;
                }
            }
            //else
            //{
            //    parent.window.document.getElementById('fmain').style.display = "none";
            //    parent.window.document.getElementById('fmap').style.display = "";
            //}

        }
    }


    function SetFmainSrc(id) {
        // 啥也不干
        return;
        // if (parent.window.document.getElementById('fmain').style.display == "none") {
        //     parent.window.document.getElementById('fmain').style.display = "";
        //     parent.window.document.getElementById('fmap').style.display = "none";
        // }

        var fmain = window.parent.document.getElementById("fmain");

        if (id != "350" && id != "450" && id != "500")
            fmain.src = "/BasePlatform/menu/SecondMenu.html?id=" + id;

    }


    //var urlinfo = window.location.href; //获取当前页面的url
    //var len = urlinfo.length; //获取url的长度
    //var offset = urlinfo.indexOf("?"); //设置参数字符串开始的位置
    //var newsidinfo = urlinfo.substr(offset, len)//取出参数字符串 这里会获得类似“id=1”这样的字符串
    //var newsids = newsidinfo.split("="); //对获得的参数字符串按照“=”进行分割    // var  xzq=Number(newsids[1]);//得到参数值



    var sysIdx = "";
    //var param = getQueryString("p");
    //var userno = getUser();
    var userInfo = getUserInfo();
    var ismanager = (userInfo[0] && userInfo[0].hasOwnProperty("ISMANAGER")) ? userInfo[0].ISMANAGER : null;
    var islogin = "";

    var sidebarmenu = document.getElementById("sidebarmenu");

    var rootvalue;
    var leafvalue;
    var liId;
    var number = 0;
    var c = 0;

    //if (userno) { 
    $.ajax({
        type: "post",
        async: false,
        url: "/BaseAshx/User/RegistUser.ashx",
        data: {
            mtype: "InitialUserAuthority",
            //userno: userno,
            formanager: ismanager,
            sysIdx: sysIdx
        }, 
        success: function (result) {
            if (result) {
                var treedata = JSON.parse(result);

                rootvalue = 0;
                leafvalue = 1;

                for (var j = 0; j < treedata.length; j++) {
                    if (rootvalue != treedata[j].PNAME) {
                        SetFirstClassTitle("/img/mainmenu/" + treedata[j].WEBPATH, treedata[j].PNAME,
                            treedata[j].PNO, treedata[j].URL, treedata[j].NAME);
                        number++;
                        c = c + 1;
                    } else {
                        if (leafvalue != treedata[j].NAME) {
                            SetSecoundClassTitle(treedata[j].URL, treedata[j].NAME);
                        }
                    }
                    rootvalue = treedata[j].PNAME;
                    leafvalue = treedata[j].NAME;
                }
            }
        },
        error: function (err) {
            if (err.status == 405)
                top.location.href = '/';
        }
    });
    //}

    function SetFirstClassTitle(x, y, pno, u, v) {
        var li = document.createElement("li");
        li.setAttribute("class", "treeview");
        li.setAttribute("id", "l" + number);
        li.setAttribute("style", "border:1px solid #181820;border-right:0px solid #181820;");
        var a = document.createElement("a");
        a.setAttribute("href", "#");
        if (pno != "")
            a.setAttribute("onclick", "SetFmainSrc(" + pno + ")");

        a.setAttribute("style", "background-color:#2d3041;color:white;");
        var img = document.createElement("img");
        img.setAttribute("src", x);
        img.setAttribute("style", "width:23px;height:23px; margin-left:10px; margin-top:1px;");
        var span = document.createElement("span");
        span.setAttribute("style", "margin-left:18px;");
        span.innerHTML = y;
        var span2 = document.createElement("span");
        span2.setAttribute("class", "pull-right-container");
        var i = document.createElement("i");
        i.setAttribute("class", "fa fa-angle-left pull-right");
        span2.appendChild(i);
        a.appendChild(img);
        a.appendChild(span);
        a.appendChild(span2);
        li.appendChild(a);

        var ul = document.createElement("ul");
        ul.setAttribute("class", "treeview-menu");
        var li2 = document.createElement("li");
        var a2 = document.createElement("a");
        //        a2.setAttribute("href", treedata[j].URL);
        //if (y == "公众查询应用服务" || y == "规划应用服务" || y == "专题应用服务" || y == "地图服务" || y == "通用应用服务" || y == "监管应用服务") {
        //if (v == "公众查询应用服务" || v == "规划应用服务" || v == "地图服务" || v == "监管应用服务" || v == "空间分析服务") {
        //    a2.setAttribute("href", u);
        //}
        //else {
        //a2.setAttribute("href", u);
        //a2.setAttribute("target", "fmain");
        //}
        dic_menu[v] = u;
        a2.setAttribute("href", "#");
        a2.setAttribute("onclick", "SwitchPageToFmain('" + u + "','" + v + "', this)");
        a2.setAttribute("style", "border-bottom:1px solid rgb(46, 49, 65);");
        var img2 = document.createElement("img");
        img2.setAttribute("src", "img/subcal.png");
        img2.setAttribute("style", "width:10px;height:10px; margin:auto 16px auto 23px");
        var font = document.createElement("font");
        font.setAttribute("color", "white");
        font.setAttribute("size", "2.5");
        //        font.innerHTML = treedata[j].NAME;
        font.innerHTML = v;
        a2.appendChild(img2);
        a2.appendChild(font);
        li2.appendChild(a2);
        ul.appendChild(li2);
        li2.setAttribute("type", y);
        ul.setAttribute("id", "" + number);
        li.appendChild(ul);

        sidebarmenu.appendChild(li);
    }

    function SetSecoundClassTitle(u, v) {
        var ul = document.getElementById("" + (number - 1));
        ul.style.paddingLeft = "0px";
        var li2 = document.createElement("li");
        var a2 = document.createElement("a");
        //if (v == "公众查询应用服务" || v == "规划应用服务" || v == "地图服务" || v == "监管应用服务" || v == "空间分析服务" || v == "数据浏览服务" || v == "数据查询服务") {
        //    a2.setAttribute("href", u );

        //    //if (v == "地图服务" || v == "数据浏览服务" || v == "数据查询服务")
        //    //    a2.setAttribute("target", "blank");
        //    //else
        //        a2.setAttribute("target", "fmain");
        //}
        ////else if (v == "审批应用服务") {
        ////    a2.setAttribute("href", u);
        ////    a2.setAttribute("target", "blank");
        ////}
        //else {
        //a2.setAttribute("href", u);
        //a2.setAttribute("target", "fmain");
        //}

        dic_menu[v] = u;
        a2.setAttribute("href", "#");
        a2.setAttribute("onclick", "SwitchPageToFmain('" + u + "','" + v + "', this)");


        a2.setAttribute("style", "border-bottom:1px solid #2e3141;");
        var img2 = document.createElement("img");
        img2.setAttribute("src", "img/subcal.png");
        img2.setAttribute("style", "width:10px;height:10px; margin:auto 16px auto 23px");
        var font = document.createElement("font");
        font.setAttribute("color", "white");
        font.setAttribute("size", "2.5");
        font.innerHTML = v;
        a2.appendChild(img2);
        a2.appendChild(font);
        li2.appendChild(a2);
        ul.appendChild(li2);
        $(".treeview-menu").find("li").css("background-color", "#252733");
    }

    //if (param == 1) {
    //    $("#sidebar ul #l2 a").next("ul").show();
    //    $("#sidebar ul #l2 a").click(function () {
    //        $(this).next("ul").toggle();
    //    });
    //}
    //else if (param == 2) {
    //    $("#sidebar ul #l3 a").next("ul").show();
    //    $("#sidebar ul #l3 a").click(function () {
    //        $(this).next("ul").toggle();
    //    });
    //}
    //else if (param == 3) {
    //    $("#sidebar ul #l4 a").next("ul").show();
    //    $("#sidebar ul #l4 a").click(function () {
    //        $(this).next("ul").toggle();
    //    });
    //}
    //else if (param == 4) {
    //    $("#sidebar ul #l0 a").next("ul").show();
    //    $("#sidebar ul #l0 a").click(function () {
    //        $(this).next("ul").toggle();
    //    });
    //}
    //else if (param == 5) {
    //    $("#sidebar ul #l1 a").next("ul").show();
    //    $("#sidebar ul #l1 a").click(function () {
    //        $(this).next("ul").toggle();
    //    });
    //}
</script>
<style>
</style>
</html>